<script>
  function days_between(date1,date2)
  {
    var ONE_DAY=1000*60*60*24;

    var date1_ms=date1.getTime();
    var date2_ms=date2.getTime();
    var difference_ms=Math.abs(date1_ms - date2_ms);

    return Math.round(difference_ms/ONE_DAY)
  }
  var date_after=new Date();
  date_after.setYear(2008);
  document.write("<br>the days is "+days_between(new Date(),date_after));
</script>
